package defpackage; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.text.Html; import cn.wps.moffice.extlibs.Qing3rdLoginConstants; import cn.wps.moffice_eng.R; import com.appsflyer.share.Constants; import java.net.HttpURLConnection; import java.net.URL; import org.eclipse.paho.client.mqttv3.internal.ClientDefaults; /* renamed from: kii reason: default package */ public final class kii { public Context mContext; public kii(Context context) { this.mContext = context; } public static void dfa() { switch (cqt.asE()) { case appID_writer: dwp.km("writer_share_youdao"); return; case appID_pdf: dwp.km("pdf_share_youdao"); return; case appID_spreadsheet: dwp.km("et_share_youdao"); return; case appID_presentation: dwp.km("ppt_share_youdao"); return; default: dwp.km("public_share_youdao"); return; } } public final void deY() { if (!lwd.hu(this.mContext)) { lvg.d(this.mContext, R.string.public_noserver, 1); return; } czq czq = new czq(this.mContext); String string = this.mContext.getString(R.string.public_youdao_note_not_installed); if (!lwd.isWifiConnected(this.mContext)) { string = string + String.format("<br/><font color=\"#ff0000\">%s</font>", this.mContext.getString(R.string.public_youdao_note_download_warn)); } czq.setMessage(Html.fromHtml(string)); czq.setPositiveButton(R.string.documentmanager_auto_update_btn_ok, new DialogInterface.OnClickListener() { /* class defpackage.kii.AnonymousClass1 */ static /* synthetic */ String a(AnonymousClass1 r2, String str) throws Exception { HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection(); httpURLConnection.setInstanceFollowRedirects(false); httpURLConnection.setConnectTimeout(5000); return httpURLConnection.getHeaderField(Constants.HTTP_REDIRECT_URL_HEADER_FIELD); } public final void onClick(DialogInterface dialogInterface, int i) { fcx.p(new Runnable() { /* class defpackage.kii.AnonymousClass1.AnonymousClass1 */ public final void run() { try { haa.bXr().bb(kii.this.mContext, AnonymousClass1.a(AnonymousClass1.this, "http://hoplink.ksosoft.com/laj1dx")); dwp.km("public_download_youdao"); } catch (Throwable th) { Intent intent = new Intent("android.intent.action.VIEW"); intent.setData(Uri.parse("http://hoplink.ksosoft.com/laj1dx")); kii.this.mContext.startActivity(intent); } } }); } }); czq.setNegativeButton(R.string.public_cancel, new DialogInterface.OnClickListener() { /* class defpackage.kii.AnonymousClass2 */ public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }); czq.show(); } public final void deZ() { dwp.km("public_open_youdao"); try { Intent intent = new Intent("com.youdao.note.action.OPEN_NOTE_APP"); intent.setFlags(ClientDefaults.MAX_MSG_SIZE); intent.putExtra("from", Qing3rdLoginConstants.WPS_UTYPE); this.mContext.startActivity(intent); } catch (Exception e) { Intent intent2 = new Intent(); intent2.setFlags(ClientDefaults.MAX_MSG_SIZE); intent2.setClassName("com.youdao.note", "com.youdao.note.activity2.MainActivity"); this.mContext.startActivity(intent2); } } public final void eJ(String str, String str2) { dfa(); try { Intent intent = new Intent("com.youdao.note.action.CREATE_PLAIN_NOTE"); intent.putExtra("android.intent.extra.TITLE", str); intent.putExtra("android.intent.extra.TEXT", str2); intent.putExtra("from", Qing3rdLoginConstants.WPS_UTYPE); this.mContext.startActivity(intent); } catch (Exception e) { Intent intent2 = new Intent("android.intent.action.SEND"); intent2.setType("text/plain"); intent2.putExtra("android.intent.extra.SUBJECT", str); intent2.putExtra("android.intent.extra.TEXT", str2); intent2.setClassName("com.youdao.note", "com.youdao.note.activity2.ActionSendActivity"); this.mContext.startActivity(intent2); } } }